<template>
  <div class="puSwiper kwSwiper">
    <div class="swiper-wrapper" >
      <div v-for="item in list " class="swiper-slide" v-on:click="bannerClick(item.titleUrl)" >
          <img :src="item.titlePic">
      </div>
    </div>
    <!-- Add Pagination -->
    <div class="swiper-pagination"></div>
  </div>
</template>
<script>
  export default {
    name: 'Swiper',
    beforeCreate() {
      var me = this;
      me.$http.get('http://m.nsr.com.cn/xinsilu/v1/polls/pollsInfo?pollsId=47&siteid=1&isShowTitle=0', {

        // me.$http.get('/static/testData/missWorldBannerData.json', {
        params: {}
      }).then(response => {
        if (response.data.code == 'R0000000') {
          me.list.push(...response.data.data);
        }
      }, response => {
      });
    },
    mounted() {
      document.write(unescape("%3Cscript src='https://cdnjs.cloudflare.com/ajax/libs/Swiper/4.3.3/js/swiper.js'  id='jsSearchScript'   type='text/javascript'%3E%3C/script%3E"));
      document.write(unescape("%3Cscript src='http://m.nsr.com.cn/testMw/static/js/smigoo.js'    type='text/javascript'%3E%3C/script%3E"));
    },
    methods:{
      bannerClick:function(url){
        if(url)
        document.location.href=url;
      }
    },
    //数据
    data(){
      return {
        list: []
      }
    }
  }

  import "../../../static/js/jquery-1.8.3.min.js"
  import "../../../static/js/swiper.min.js"
  import "../../../static/js/smigoo.js"
</script>
<style>
  @import "../../css/swiper.min.css";
</style>
